# Locale

## Installation
`npm i @snack-uikit/locale`

## Usage

You need to wrap your app into `<LocaleProvider>` to make translations work.

If you don't do it then **default** (en_GB) translations will be applied if applicable.

Also you can pass custom translations or replace/modify existing.

### Note
When changing translations of existing languages, you can specify only the fields you want to change, as they will be merged with the default fields.

But when passing a custom language, you will have to specify all translations.

### Example

```tsx
import { LocaleProvider, OverrideLocales } from '@snack-uikit/locale';

const customTraslations: OverrideLocales = {
  en_GB: {
    Table: {
      searchPlaceholder: 'custom',
    },
  },
  custom_LANG: {
    Table: {
      searchPlaceholder: 'custom',
      // ...
    },
  },
};

const lang = 'en_GB'; // or 'ru_RU' or 'custom_LANG'

  // ...
  <LocaleProvider lang={lang} locales={customTranslations}>
    {content}
  </LocaleProvider>
```

[Changelog](./CHANGELOG.md)



[//]: DOCUMENTATION_SECTION_START
[//]: THIS_SECTION_IS_AUTOGENERATED_PLEASE_DONT_EDIT_IT
## LocaleProvider
### Props
| name | type | default value | description |
|------|------|---------------|-------------|
| lang* | `string` | - |  |
| locales | `PartialObjectDeep<Record<string, { Table: { searchPlaceholder: string; noData: { title: string; }; noResults: { title: string; description: string; }; errorData: { title: string; description: string; }; rowsOptionsLabel: string; export: string; }; List: { ...; }; Chips: { ...; }; Fields: { ...; }; SearchPrivate: { ....` | - |  |
## useLocale
`helper` 

Inner hook to use translations


[//]: DOCUMENTATION_SECTION_END
